Напишите программу, которая проверяет, является ли число числом Армстронга.
Число Армстронга — натуральное число, которое в данной системе счисления равно сумме своих цифр, возведённых в степень, равную количеству его цифр. Пример:
3**3 + 7**3 + 1**3 = 371
Решение: def armstrong_number(num): sum = 0 length = len(str(num)) for digit in list(str(num)): sum += int(digit)**length return sum == num
Напишите программу, которая проверяет, является ли число числом Армстронга.
Число Армстронга — натуральное число, которое в данной системе счисления равно сумме своих цифр, возведённых в степень, равную количеству его цифр. Пример:
3**3 + 7**3 + 1**3 = 371
Решение: def armstrong_number(num): sum = 0 length = len(str(num)) for digit in list(str(num)): sum += int(digit)**length return sum == num
Свой вариант решения в комментарии 💬
#задачи
BY Python Turbo. Уютное сообщество Python разработчиков.
You can’t. What you can do, though, is use WhatsApp’s and Telegram’s web platforms to transfer stickers. It’s easy, but might take a while.Open WhatsApp in your browser, find a sticker you like in a chat, and right-click on it to save it as an image. The file won’t be a picture, though—it’s a webpage and will have a .webp extension. Don’t be scared, this is the way. Repeat this step to save as many stickers as you want.Then, open Telegram in your browser and go into your Saved messages chat. Just as you’d share a file with a friend, click the Share file button on the bottom left of the chat window (it looks like a dog-eared paper), and select the .webp files you downloaded. Click Open and you’ll see your stickers in your Saved messages chat. This is now your sticker depository. To use them, forward them as you would a message from one chat to the other: by clicking or long-pressing on the sticker, and then choosing Forward.
A project of our size needs at least a few hundred million dollars per year to keep going,” Mr. Durov wrote in his public channel on Telegram late last year. “While doing that, we will remain independent and stay true to our values, redefining how a tech company should operate.
Python Turbo Уютное сообщество Python разработчиков from es